<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<html>

<head><style>
body{background:url(2.jpg) top left;
background-size:100%;}
</style></head>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="css/inputstyle.css" />
<title>添加学生信息</title>
<style type="text/css">
<!--
.STYLE1 {
	color: #CC9900;
	font-weight: bold;
	font-family: "微软雅黑";
	font-size: 16pt;
}
.STYLE4 {
	font-weight: bold;
	font-family: "微软雅黑";
}
-->
</style>
</head>
<%
//连接MySQL数据库
//1、装在MySQL数据库的驱动程序
// "com.mysql.jdbc.Driver"---mysql-connector-java-5.1.30-bin.jar文件
Class.forName("com.mysql.jdbc.Driver").newInstance();
//2、MySQL的URL地址
//jdbc：说明采用JDBC的方式来访问数据库
//mysql：说明连接的是MYSQL数据库
//127.0.0.1：数据库所在的服务器的网络地址
//3306：mysql默认的端口号
//itcast：数据库的名称
String url="jdbc:mysql://127.0.0.1:3306/student?useUnicode=true&characterEncoding=utf8";
// 3、用户名和密码
String dbusername="root";
String dbpassword="";
Connection conn=DriverManager.getConnection(url,dbusername,dbpassword);
Statement stmt=conn.createStatement();
//T_STUDENTS

%>

<style type="text/css">
table.hovertable {
    font-family: verdana,arial,sans-serif;
    font-size:11px;
    color:#333333;
    border-width: 1px;
    border-color: #999999;
    border-collapse: collapse;
}
table.hovertable th {
    background-color:#c3dde0;
    border-width: 1px;
    padding: 8px;
    border-style: solid;
    border-color: #a9c6c9;
}
table.hovertable tr {
    background-color:#d4e3e5;
}
table.hovertable td {
    border-width: 1px;
    padding: 8px;
    border-style: solid;
    border-color: #a9c6c9;
}
.STYLE7 {font-size: 16px}
</style>

<body>
<form name="form1" method="post" action="save.jsp">
<table width="325" height="316" border="1"  align="center" class="hovertable" valign="middle">
  <tr>
    <td colspan="2"><div align="center" class="STYLE1">添加学生信息</div></td>
  </tr>
  <tr>
    <td width="110" height="49"><div align="center" class="STYLE4 STYLE7">
      姓名</div></td>
    <td width="223"><input name="name" type="text" size="30" height="25"></td>
  </tr>
  <tr>
    <td height="49"><div align="center" class="STYLE4 STYLE7">
      学号</div></td>
    <td><input name="number" type="text" size="30" height="25"></td>
  </tr>
  <tr>
    <td height="49"><div align="center" class="STYLE4 STYLE7">
      科目</div></td>
    <td><input name="subject" type="text" size="30" height="25"></td>
  </tr>
  <tr>
    <td height="49"><div align="center" class="STYLE4 STYLE7">
      成绩</div></td>
    <td><input name="score" type="text" size="30" height="25"></td>
  </tr>
  
  <tr>
    <td height="" align="center">        <input name="clear" type="button" class="btn_warning" id="clear" onClick="javascript:window.location='main.jsp'" value="返回">      </td>
	 
    <td><div align="center" ><input name="save" type="submit" class="bgclass2" id="save" value="保存并添加"></div></td>
  </tr>
</table>
</form>
</body>
</html>
